package tfts

type stackType int

const (
	NoStk stackType = iota
	AsStk
	CastStk
	AtkStk
)

type skill struct {
	callable
	next *skill
}

func (s *skill) cast(champ *Fight) {
	// 施法技能前先添加buff
	// 使技能可以享受到buff加成
	if s.buff != nil {
		s.buff.attach(champ)
	}
	dmg := s.damage(champ)
	dmg = dmg * float64(champ.castRate) / 100
	champ.CastTimes++
	champ.record(dmg, CastS)
	if !champ.recordSteal(dmg, CastS) {
		actionLog("%4.1f秒:第%d次施法伤害%d\n", champ.Current(), champ.CastTimes, champ.CastRecord[len(champ.CastRecord)-1])
	}
	s.defence(champ)
	if s.next != nil {
		champ.skill = s.next
	}
}
